package com.fizzkai.controller;

import com.fizzkai.domain.User;
import com.fizzkai.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName UserController
 * @Description TODO
 * @Author weijh3
 * @Date 2018/11/26 下午5:45
 * @Version 1.0
 **/
@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    UserService userService;

    @RequestMapping("/hello")
    public Object hello() {
        return "{ \"msg\": \"Hello World!!\" }";
    }

    @RequestMapping("/all")
    public Object all() {
        return userService.queryAll();
    }


    @RequestMapping("/get")
    public Object get(Long id) {
        return userService.get(id);
    }



    @RequestMapping("/testIn")
    public Object testIn(Long min, Long max) {
        return userService.testIn(min, max);
    }
    @RequestMapping("/add")
    public Object add(User user) {
        userService.add(user);
        return "xxx";
    }


}
